package com.topView2;

import com.bean.TreeNode;

/**
 * @Author: huangzhigao
 * @Date: 2023/2/12 19:40
 */
public class leecode104 {
    public int maxDepth(TreeNode root) {
        if (root == null) {
            return 0;
        }

        int leftMax = maxDepth(root.left);
        int rightMax = maxDepth(root.right);
        return Math.max(leftMax, rightMax) + 1;
    }
}
